import http from './http/index';

// 获取首页统计数据
// 司机
export function apiGetDriverHomeData(data: any) {
  return http({
    method: 'GET',
    url: `/api/mobile/driver/home/${data.driver_id}`,
  });
}

// 获取首页列表
// 司机
export function apiGetDriverHomePage(data: any) {
  return http({
    method: 'POST',
    url: `/api/mobile/driver/orders/list`,
    data,
  });
}

// 获取我的页面统计数据
export function apiGetDriverMineData(data: any) {
  return http({
    method: 'GET',
    url: `/api/mobile/driver/dispatches/${data.driver_id}`,
  });
}

// 获取首页统计数据
// 调度
export function apiGetDispatchHomeData() {
  return http({
    method: 'GET',
    url: `/api/mobile/dispatcher/stats/sumToday`,
  });
}

export function apiGetDispatchHomeMile() {
  return http({
    method: 'POST',
    url: `/api/vms/car/calculate_trajectory_mileage`,
  });
}

// 获取首页列表
// 调度
export function apiGetDispatchHomePage(data: any) {
  return http({
    method: 'POST',
    url: `/api/mobile/dispatcher/order/approve/list`,
    data,
  });
}

// 获取我的页面统计数据
export function apiGetDispatchMineData() {
  return http({
    method: 'GET',
    url: `/api/mobile/dispatcher/home/count`,
  });
}

export function apiGetCarPos(data: any) {
  return http({
    method: 'POST',
    url: `/api/vms/car/query/latest/points/by/driver_id`,
    data,
  });
}
